package cn.donting.jme.edit.ui.inspector.imp.transform;

import cn.donting.jme.edit.ex.InspectorUILoader;
import cn.donting.jme.edit.ui.inspector.InspectorUI;
import cn.donting.jme.edit.util.IconUtils;
import com.jme3.scene.Spatial;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.layout.Pane;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class TransformUILoader implements InspectorUILoader {
    @Override
    public List<InspectorUI> getInspectorUI(Spatial spatial) throws IOException {
        ArrayList<InspectorUI> inspectorUIS = new ArrayList<>();
        FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getClassLoader().getResource("cn/donting/jme/edit/ui/inspector/imp/transform/Transform.fxml"));
        Pane uiNode = fxmlLoader.load();
        TransformController controller = fxmlLoader.getController();
        controller.setSpatial(spatial);
        inspectorUIS.add(new InspectorUI(uiNode,"Transform", IconUtils.getImageView("icon/transform.png")));
        return inspectorUIS;
    }

}
